package com.wish.wishhouse_foreclosure.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

@Getter
public enum PaymentPayEnum {
    /**
     * 付款方式-付
     * @author lzj
     *
     */
        PAY_ONE("1",1),
        PAY_TWO("2",2),
        PAY_THR("3",3),
        PAY_FOUR("4",4),
        PAY_FIV("5",5),
        PAY_SIX("6",6);
        @JsonValue
        private String name;
        @EnumValue
        private int index;

        private PaymentPayEnum(String name, int index) {
            this.name = name;
            this.index = index;
        }

        // 普通方法
        public static String getName(int index) {
            for (PaymentPayEnum c : PaymentPayEnum.values()) {
                if (c.getIndex() == index) {
                    return c.name;
                }
            }
            return null;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getIndex() {
            return index;
        }

        public void setIndex(int index) {
            this.index = index;
        }
}
